Skip to content

Conversation

Lucisu
Copy link

@Lucisu Lucisu commented Oct 4, 2022

Fixes issue #230 by checking if the variable is global before assigning it to the $this->last_doc.

@kkmuffme
Copy link

kkmuffme commented Apr 3, 2023

We also need to reset the last doc to null, when we declare a function/method, as otherwise it will apply the tags in cases like:

/**
 * @deprecated some text 
 */
add_filter( 'foo', 'bar' );

/**
 * @deprecated other text
 */
function hello() {
	return apply_filters( 'my_filter', '' );
}

"my_filter" will suddenly have the @deprecated some text comment added, even though it's completely irrelevant

Just add $this->last_doc = null; before this line

array_push( $this->location, $node );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants